/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.chlitina.store.modules.cash.service;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.chlitina.store.common.service.BaseService;
import com.chlitina.store.modules.base.dao.StoreCareDao;
import com.chlitina.store.modules.base.dao.StoreProductDao;
import com.chlitina.store.modules.base.entity.StoreCare;
import com.chlitina.store.modules.base.entity.StoreProduct;
import com.chlitina.store.modules.base.service.StoreProductService;
import com.chlitina.store.modules.sys.entity.Store;
import com.chlitina.store.modules.sys.utils.StoreUtils;

/**
 * 散客消费Service
 * @author Songsong.xu
 * @version 2013-11-06
 */
@Component
@Transactional(readOnly = true)
public class NomemberService extends BaseService {
	@SuppressWarnings("unused")
	private static Logger logger = LoggerFactory.getLogger(NomemberService.class);
	@Autowired
	private StoreProductDao storeProductDao;
	@Autowired
	private StoreProductService storeProductService;
	@Autowired
	private StoreCareDao storeCareDao;
	
	public List<StoreProduct> findSystemProducts() {
		return  storeProductService.findByStatus(StoreProduct.TYPE_SYS, -1);
	}
	
	public List<StoreProduct> findStoreProducts() {
		return storeProductService.findByStore();
	}
	
	public List<StoreProduct> findStoreSelfProducts() {
		return storeProductService.findByStatus(StoreProduct.TYPE_SELF, -1);
	}
	public List<StoreCare> findSystemCares() {
		Store store = StoreUtils.getStore();
		return  storeCareDao.findListByStore(store.getId(),0);
	}
	
	public List<StoreCare> findStoreCares() {
		Store store = StoreUtils.getStore();
		return storeCareDao.findListByStore(store.getId());
	}
	
	public List<StoreCare> findStoreSelfCares() {
		Store store = StoreUtils.getStore();
		return  storeCareDao.findListByStore(store.getId(),1);
	}
}
